package com.thon.entity.project;

// Generated 2013-9-23 19:12:56 by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.thon.entity.user.User;
import com.thon.entity.util.IdEntity;

/**
 * MeProjectComment generated by hbm2java
 */
@Entity
@Table(name = "project_comments")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProjectComment extends IdEntity {

	private static final long serialVersionUID = -2929003781872141918L;
	private Project project;
	private String content;
	private Date createdDate;
	private Integer commentTo;
	private Integer userId;
	private Integer isRead;//0假 1真
	private Integer isDelete;//0假 1真
	private ProjectComment superComment;
	private Preferential preferential;

	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "preferential_id", nullable = true)
	@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
	public Preferential getPreferential() {
		return preferential;
	}

	public void setPreferential(Preferential preferential) {
		this.preferential = preferential;
	}

	public ProjectComment() {
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "project_id", nullable = true)
	@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Integer getCommentTo() {
		return this.commentTo;
	}

	public void setCommentTo(Integer commentTo) {
		this.commentTo = commentTo;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "super_id", nullable = true)
	@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
	public ProjectComment getSuperComment() {
		return superComment;
	}

	public void setSuperComment(ProjectComment superComment) {
		this.superComment = superComment;
	}

	public Integer getIsRead() {
		return isRead;
	}

	public void setIsRead(Integer isRead) {
		this.isRead = isRead;
	}

	public Integer getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}


}
